package com.example.helloImageDetection;

import gestoreImmagini.Logo;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class InfoLogoView extends RelativeLayout{
	
	private ImageView mLogoImg;
	private TextView mLogoNome;
	private TextView mLogoDescr;
	private Context context;
	

	public InfoLogoView(Context context, AttributeSet attrs) {
		super(context, attrs);
		this.context = context;
		init();
	}
	
	public InfoLogoView(Context context) {
		super(context);
		this.context = context;
		init();
	}
	
	
	private void init() {
		//recupero il layout
		LayoutInflater inflater = (LayoutInflater) (((Activity)context).getSystemService(Context.LAYOUT_INFLATER_SERVICE));
		inflater.inflate(R.layout.info_logo_view, this);
	
		mLogoImg = (ImageView) findViewById(R.id.logo_riconosciuto_img);
		mLogoNome = (TextView) findViewById(R.id.logo_riconosciuto_nome);
		mLogoDescr = (TextView) findViewById(R.id.logo_riconosciuto_descr);
	}

	public void setLogo(Logo logo){
		mLogoImg.setImageBitmap(logo.getLogo());
		mLogoNome.setText(logo.getNome());
		mLogoDescr.setText(logo.getDescrizione());
	}
	
//	public void setQuery(Bitmap img){
//		ImageView mQueryImg = (ImageView) findViewById(R.id.logo_query_img);
//		mQueryImg.setImageBitmap(img);
//	}


	
}
